From: kaf24@firebug.cl.cam.ac.uk Date: Wed, 28 Sep 2005 21:18:30 +0000 (+0100) Subject: Fix fixed-point long multiplication used in time delta X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16769^2~15 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=47fa53bbb45911f433fc22837d48597f57b846dd;p=xen.git Fix fixed-point long multiplication used in time delta calculations. The carry flag was clobbered before it was added to the result. Signed-off-by: Keir Fraser --- diff --git a/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c b/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c index 1de1bb89c0..793977fbd6 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c @@ -186,8 +186,8 @@ static inline u64 scale_delta(u64 delta, u32 mul_frac, int shift) "mov %4,%%eax ; " "mov %%edx,%4 ; " "mul %5 ; " - "add %4,%%eax ; " "xor %5,%5 ; " + "add %4,%%eax ; " "adc %5,%%edx ; " : "=A" (product), "=r" (tmp1), "=r" (tmp2) : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) ); diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c index 7e972bea94..e7202174f8 100644 --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -119,8 +119,8 @@ static inline u64 scale_delta(u64 delta, struct time_scale *scale) "mov %4,%%eax ; " "mov %%edx,%4 ; " "mul %5 ; " - "add %4,%%eax ; " "xor %5,%5 ; " + "add %4,%%eax ; " "adc %5,%%edx ; " : "=A" (product), "=r" (tmp1), "=r" (tmp2) : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (scale->mul_frac) );